ARG BUILD_ENV=""
# docker build --build-arg BUILD_ENV="development"
FROM node:14-buster-slim as build
WORKDIR /app
RUN set -eux; \
    apt-get update; apt-get install git; \
	  npm config set registry http://registry.npmmirror.com; \
	  git clone https://xxx.git source-file; \
	  cd source-file; npm install; npm run build:${BUILD_ENV};

FROM nginx:1.23.2-alpine-perl
# WORKDIR /usr/share/nginx/html
COPY --from=build /app/source-file/dist /usr/share/nginx/html
